package test.study.rpc.sofa.bolt;

import com.alipay.remoting.rpc.RpcClient;
import lombok.SneakyThrows;
import study.rpc.sofa.bolt.support.io.MyRequest;
import study.rpc.sofa.bolt.support.io.MyResponse;

public class MyClient {

    static String address = "127.0.0.1:8899";


    static RpcClient client;

    public static void start() {
        client = new RpcClient();

        client.startup();
    }

    @SneakyThrows
    public static void main(String[] args) {
        MyClient.start();

        MyRequest request = new MyRequest();
        request.setName("wangzhj");
        MyResponse response = (MyResponse) client.invokeSync(address, request, 30 * 1000);
        System.out.println(response.getMsg());
    }
}
